<script>
import { setWeChatUrl } from '@/config'
export default {
  onLaunch: function () {
    // 获取存储的token
    // #ifdef H5
    const token = uni.getStorageSync('xiahui-token')
    if (token) {
      this.$store.commit('SET_TOKEN', token)
    }
    // #endif
    this.$store.dispatch('getUserInfo')

    // #ifdef MP-WEIXIN
    const accountInfo = uni.getAccountInfoSync()
    let version = accountInfo.miniProgram.envVersion
    setWeChatUrl(version)
    // #endif

    //切换语言
    uni.setLocale('zh-Hans')
    this.$i18n.locale = 'zh-Hans'
  },
  onShow: function () {
    console.log('App Show')
  },
  onHide: function () {
    console.log('App Hide')
  }
}
</script>

<style lang="scss">
@import '@/uni_modules/uview-ui/index.scss';
page {
  background-color: #f5f5f5;
  font-size: 14px;
}
/*每个页面公共css */
// *{
// 	font-family: Arial, Helvetica, sans-serif
// }
@font-face {
  font-family: 'iconfont'; /* Project id 3574684 */
  src: url('https://at.alicdn.com/t/c/font_3574684_huzjftkk5rc.woff2?t=1659942302916')
      format('woff2'),
    url('https://at.alicdn.com/t/c/font_3574684_huzjftkk5rc.woff?t=1659942302916') format('woff'),
    url('https://at.alicdn.com/t/c/font_3574684_huzjftkk5rc.ttf?t=1659942302916') format('truetype');
}
.iconfont {
  font-family: iconfont;
  font-size: 14px;
}
</style>
